package efu.nf.like.common.exception;


import efu.nf.like.common.enumeration.ErrorStatusEnum;

/**
 * @author lwj
 * @date 2025-05-19
 * @vesion 1.0.0
 */
public class GlobalException extends RuntimeException{
    /**
     * 错误码
     */
    private Integer errorCode;

    public GlobalException(Integer errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public GlobalException(ErrorStatusEnum statusEnum) {
        super(statusEnum.getMessage());
        this.errorCode = statusEnum.getCode();
    }

    public Integer getErrorCode() {
        return errorCode;
    }
}